'use strict';

angular.module('WDCC').controller('LoginCtrl', function($scope, $location, $rootScope, $cookieStore,toastr,$http) {
	
	$scope.LoginInfo={};
   //登录跳转
	$scope.LoginTrans = function(){
		$http.post($rootScope.app.ath + 'DoctorLoginTrans.json',$scope.LoginInfo).success(function(res){
			if(res.returnCode=="000010" || res.returnCode=="000003"){
				$location.path('/');
				toastr.error(res.exceptionMessage);
			}else if(res.returnCode=="000000"){
				$rootScope.UserBean.DoctorInfo =  res.DoctorInfo;
				$rootScope.QueryMessageList();
				if($rootScope.UserBean.DoctorInfo.AccountType=="A"){
					$location.path('/RoleMgmt');					
				}else{
					$location.path('/Welcom');
				}
				

			}else{
				toastr.error(res.exceptionMessage);
			}
		});
		
		
	}
    console.log("wee")
    $scope.otherHtml = function(){
        console.log("wee")
        $location.path('/homePage');

    }

	
});